<template>
    <view class="uni-padding-wrap uni-common-pb">
        <form @submit="formSubmit" @reset="formReset">
            <view class="uni-header-logo">
                <image src="../../../static/me2.png"></image>
            </view>
            <view class="uni-hello-text uni-common-pb">
                修改资料
            </view>
            <view class="uni-form-item uni-column">
                <input class="uni-input" name="name" @input="onKeyInput" placeholder="修改姓名" />
            </view>
            <view class="uni-btn-v">
                <button class="btn-submit" formType="submit" type="primary">Submit</button>
                <!-- <button type="primary" @tap="bindpostBless">发送</button> -->
            </view>
        </form>
    </view>
</template>
<script>
import {get} from '@/utils/index';
import {getActDetails,getSignList} from '@/utils/api';
//来自 graceUI 的表单验证， 使用说明见手册 http://grace.hcoder.net/doc/info/73-3.html
var  graceChecker = require("../../../common/graceChecker.js");
export default {
    mounted(){
        
    },
    methods: {
        formSubmit: function (e) {
            //将下列代码加入到对应的检查位置
            //定义表单规则
            var rule = [
                {name:"name", checkType : "string", checkRule:"1,3",  errorMsg:"姓名应为1-3个字符"}
            ];
            //进行表单检查
            var formData = e.detail.value;
            var checkRes = graceChecker.check(formData, rule);
            if(checkRes){
                uni.showToast({title:"验证通过!", icon:"none"});
            }else{
                uni.showToast({ title: graceChecker.error, icon: "none" });
            }
        },
        formReset: function (e) {
            console.log("清空数据")
            this.chosen = ''
        }
    }
}
</script>

